package cz.muni.fi.pa165.dundd.entity;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

/**
 * The class contains roles, which can be assigned to {@link Hero}
 *
 * @author xkonval
 */
@Entity
public class HeroRole implements Serializable {

    private static final long serialVersionUID = 1L;
    
    /**
     * ID of the {@code HeroRole} in the database
     */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long id;
    
    /**
     * Name of the {@code HeroRole}
     */
    private String name;
    
    /**
     * Description of the {@code HeroRole}
     */
    private String description;

    public HeroRole() {
    }

    public HeroRole(String name, String description) {
        this.name = name;
        this.description = description;
    }

    /**
     * @return {@link HeroRole#name}
     */
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return {@link HeroRole#description}
     */
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    /**
     * @return {@link HeroRole#id}
     */
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        if (!(object instanceof HeroRole)) {
            return false;
        }
        HeroRole other = (HeroRole) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cz.muni.fi.pa165.dundd.HeroRole[ id=" + id + " ]";
    }
}
